import {RouteRecordRaw, createRouter, createWebHistory} from "vue-router";
import Layout from "@/views/Layout/index.vue";

const routes: RouteRecordRaw[] = [
	{
		path: "/",
		component: Layout,
		children: [
			{
				path: "/",
				component: () => import("@/views/Home/index.vue"),
				meta: {
					title: "首页",
				},
			},
			{
				path: "/message",
				component: () => import("@/views/Message/index.vue"),
				meta: {
					title: "留言",
				},
			},
			{
				path: "/about",
				component: () => import("@/views/About/index.vue"),
				meta: {
					title: "关于",
				},
			},
			{
				name: "说说",
				path: "/talk",
				component: () => import("@/views/Talk/index.vue"),
				meta: {
					title: "说说",
				},
			},
			{
				name: "friend",
				path: "/friend",
				component: () => import("@/views/Friend/index.vue"),
				meta: {
					title: "友链",
				},
			},
			{
				path: "/user",
				component: () => import("@/views/User/index.vue"),
				meta: {
					title: "个人中心",
				},
			},
			{
				path: "/tag",
				component: () => import("@/views/Tag/index.vue"),
				meta: {
					title: "标签",
				},
			},
			{
				path: "/album",
				component: () => import("@/views/Album/Album.vue"),
				meta: {
					title: "相册",
				},
			},
		]
	},
	{
		path: "/404",
		component: () => import("@/views/Error/404.vue"),
		meta: {
			title: "404",
		},
	},
	// {
	// 	path: "/oauth/login/gitee",
	// 	component: () => import("@/components/Oauth/404.vue"),
	// },
	// {
	// 	path: "/oauth/login/github",
	// 	component: () => import("@/components/Oauth/404.vue"),
	// },
	{path: "/:catchAll(.*)", redirect: "/404"},
];

const router = createRouter({
	history: createWebHistory(),
	routes,
});

export default router;
